Valid for Sitecore
5.2, 5.1.1
Statically Bind a Rendering
Prev Next |
Statically bind an XSL Rendering to a Layout or Sublayout to cause every invocation of that Layout or Sublayout to execute that Rendering. To statically bind an XSL Rendering to a Layout or Sublayout:
-
Using the Sitecore Desktop:
- Create the Rendering in Sitecore.
- Open the Layout or Sublayout in Layout Studio.
- Drag the Rendering from the tree on the left to the location in the Layout or Sublayout where that Rendering should be invoked.
- Double-click on the Rendering to pass parameters, set caching options or set other attributes.
-
Using Microsoft® Visual Studio .NET:
- Create the Rendering in Sitecore.
- Open the Layout or Sublayout in Visual Studio and select the HTML tab.
- Add code to the Layout or Sublayout where the Rendering should be invoked: <sc:xslfile runat="server" renderingid="{RENDERINGID}" path="{PATH}" />, where {PATH} is the path to the XSL file relative to the site’s IIS document root. The renderingid attribute is optional (in fact the XSL does not even need to be registered with Sitecore), but if specified should refer to the GUID of the Rendering, which can be determined using the System section of the Rendering object visible by opening Content Editor, changing the first entry in the treecrumb from Content to Layouts and navigating to the Rendering. Caching options can be configured by setting attributes such as cacheable, varybydata, varybydevice, varybylogin, varybyparm, varybyquerystring and varybyuser to the value “true”.
Prev Next